<?php 

/*
$startTime = time()-(1*3600*60);
$endTime = time();

$sql = "SELECT `topicid` from ".dbprefix."group_topics where `addtime`>'$startTime' and `addtime` < '$endTime'";

$arrLikeTopics = $db->fetch_all_assoc($sql);

foreach($arrLikeTopics as $key=>$item){
	$arrLikeTopic[] = $item['topicid'];
}

$strTopic = array_to_str($arrLikeTopic);

echo $strTopic;
*/

/*
	$strLike = $db->once_fetch_assoc("SELECT count(*) as `num`,`topicid` from ".dbprefix."group_topics_collects where `topicid` in(8237,8238,8236,8239,8240,8241,8242,8243,8244,8245,8246,8247,8248,8249,8250,8251,8252,8253,8254,8255,8256,8257,8258,8259,8260,8261,8262,8263,8264,8265,8266,8267,8268,8269,8270,8271,8272,8273,8274,8275,8276,8277,8278,8279,8280,8281,8282,8283,8284,8285,8286,8287,8288,8289,8291,8290,8292,8293,8300,8299,8301,8302,8303,8304,8305,8306,8307,8308,8309,8310,8311,8312,8313,8314,8315,8316,8317,8318) GROUP BY userid ORDER BY num DESC limit 1");
	
	$strLike['topic']=aac('group')->find('group_topics',array(
		'topicid'=>$strLike['topicid'],
	));
	
	$likeUsers = aac('group')->findAll('group_topics_collects',array(
		'topicid'=>$strLike['topicid'],
	));
	
	foreach($likeUsers as $key=>$item){
		$strLike['user'][]=aac('user')->getOneUser($item['userid']);
	}
	
	print_r($strLike);
*/

$arrTopics = $new['home']->findAll('group_topics');
foreach($arrTopics as $item){
	$new['home']->update('group_topics',array(
		'topicid'=>$item['topicid'],
	),array(
		'content'=>strip_tags($item['content']),
	));
}

echo 'OK';